package pers.wchen.mybatis.generate.util;

public class CharsTransUtil {
	/**
	 * 驼峰标识处理
	 * @param param
	 * @return
	 */
	public static String transParam(String param){
		String[] data = param.split("_");
		
		StringBuffer sbf = new StringBuffer();
		for(int i=0; i<data.length; i++){
			if(i==0){
				sbf.append(data[i]);
				continue;
			}
			String str = data[i];
			sbf.append(str.substring(0, 1).toUpperCase()).append(str.substring(1,str.length()));
			
		}
		
		return sbf.toString();
	}
	
	
	/**
	 * 首字母大写
	 * @param param
	 * @return
	 */
	public static String upperCaseFist(String param){
		String s = param.substring(0, 1).toUpperCase() + param.substring(1,param.length());
		return s;
	}
	
	
	/**
	 * 首字母小写
	 * @param param
	 * @return
	 */
	public static String lowerCaseFist(String param){
		String s = param.substring(0, 1).toLowerCase() + param.substring(1,param.length());
		return s;
	}
	
	
	public static String[] splitStr(String objStr, String regx) {
		
		return objStr.split(regx);
		
	}
	
}
